package com.example.springboot.mapper;

import com.example.springboot.controller.request.BaseRequest;
import com.example.springboot.controller.request.UserPageRequest;
import com.example.springboot.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Description:mapper接口注解实现方式
 *
 * @Author 马钰涵
 * @Create 2023/8/5 9:10
 * @Version 1.0
 */
@Mapper
public interface UserMapper {
    /**
     * 通过注解的方式，查询全部User数据
     * @return List
     */
//    @Select("select * from user")
    List<User> list();


    List<User> listByCondition(BaseRequest baseRequest);

    void save(User user);

    User getById(Integer id);

    void updateById(User user);

    void deleteById(Integer id);

    User getByUsername(String username);

    void deleteBatch(@Param("ids") List<Integer> ids);
}
